import request from '@/utils/request'

/**
 * @description 登录
 * @param {string, string} data mobile, password
 */
export const login = (data) => request({
  url: '/sys/login',
  method: 'POST',
  data
})

/**
 * @description 获取用户信息
 * @returns promise
 */
export const getUserInfoAPI = () => request({
  url: '/sys/profile',
  method: 'POST'
})

/**
 * @description 获取员工详情
 * @param {*} id
 * @returns
 */
export const getUserDetailById = (id) => request({
  url: `/sys/user/${id}`
})

/**
 * @description 保存员工基本信息
 * @param {*} data
 * @returns
 */
export const saveUserDetailById = (data) => request({
  url: `/sys/user/${data.id}`,
  method: 'PUT',
  data
})
